package com.zl.credit.controller;


import ch.qos.logback.core.net.SyslogOutputStream;
import com.zl.credit.entity.CreditInvestigation;
import com.zl.credit.service.impl.CreditInvestigationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author anonymous
 * @since 2020-07-14
 */
@RestController
@RequestMapping("/credit-investigation")
public class CreditInvestigationController {

    @Autowired
    private CreditInvestigationServiceImpl investigationService;

    /**
     * 向征信表插一条记录
     * @param investigation
     * @return
     */
    @RequestMapping(value = "/addinvestigation",method = RequestMethod.POST)
    public String addinvestigation(CreditInvestigation investigation){
        System.out.println("investigation = " + investigation);
        //主键生成
        investigation.setZxId(1243142l);
        investigationService.save(investigation);
        return "index";
    }

    /**
     * 根据征信id查询征信结果
     * @param zxId
     * @return
     */
    @RequestMapping(value = "QueryByid",method = RequestMethod.GET)
    public String QueryByid(long zxId){
        System.out.println("zxId = " + zxId);
        CreditInvestigation investigation = investigationService.getById(zxId);
        System.out.println(investigation);
        return "index";
    }
}
